<?php /*a:2:{s:74:"D:\phpStudy\WWW\tp5\application\admin\view\admin_notice\notice_update.html";i:1551894429;s:58:"D:\phpStudy\WWW\tp5\application\admin\view\admin\head.html";i:1550326401;}*/ ?>
 <!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>广州商学院lms-后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" type="text/css" href="/static/lib/layui/css/layui.css" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <script type="text/javascript" src="/static/js/jquery.js"></script>
    <script type="text/javascript" src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="x-body">
    <div class="layui-form-item">
        <label for="" class="layui-form-label">公告标题</label>
        <div class="layui-input-block">
            <input type="text" id="title" class="layui-input" placeholder="请输入公告标题" value="<?php echo htmlentities($notice['title']); ?>">
        </div>
    </div>
    <div class="layui-form-item">
        <label for="" class="layui-form-label">公告内容</label>
        <div class="layui-input-block">
            <div id="editor">
                <?php echo $notice['content']; ?>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn layui-btn-fluid" onclick="add()">修改</button>
        </div>
    </div>
    <?php if(app('session')->get('admin')): ?>
    <input type="hidden" id="author" name="author" value="<?php echo htmlentities(app('session')->get('admin.username')); ?>">
    <?php else: ?>

    <?php endif; ?>
</div>

<script>var _hmt = _hmt || []; (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();</script>
<script type="text/javascript" src="/static/lib/wangEditor-3.1.1/release/wangEditor.js"></script>
<script>
    var E = window.wangEditor
    var editor = new E('#editor')
    editor.customConfig.uploadFileName = 'images'
    editor.customConfig.uploadImgServer = "<?php echo url('notice_upload'); ?>"   // 使用 base64 保存图片  // 使用 base64 保存图片
    // editor.customConfig.uploadFileName = 'images'
    // editor.customConfig.uploadImgServer = "<?php echo url('feedback_img'); ?>"
    // 或者 var editor = new E( document.getElementById('editor') )
    editor.create()
    function add() {
        $.post(
            "",
            {
                title:$('#title').val(),
                content:editor.txt.html(),
                author:$('#author').val()
            },
            function (data) {
                layui.use('layer', function(){
                    var layer = layui.layer;
                    if (data.statu==200){
                        layer.msg(data.msg);
                        $('#title').val('');
                        editor.txt.html('<p><br></p>')
                    } else {
                        layer.msg(data.msg);
                    }
                });
            }
        )
        // alert(editor.txt.html())
    }
</script>
</body>

</html>